/*
 * @Author: angelWife zzwchilong@163.com
 * @Date: 2024-01-27 17:24:14
 * @LastEditors: angelWife zzwchilong@163.com
 * @LastEditTime: 2024-11-06 00:52:27
 * @FilePath: \steel-cloud-static\static\company\js\login.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
$(function () {
  $(".loginNav a")
    .off("click")
    .on("click", function () {
      var index = $(this).index();
      $(this).addClass("active").siblings().removeClass("active");
      var left = $(this).position().left;
      var width = $(this).width();
      $(".loginNavLine").css({ width: width + 'px', left: left + 'px' });
      $("#loginFormNav .navView").eq(index).fadeIn().siblings().hide();
      if (index == 2) {
        $("#loginBtn").hide();
      } else {
        $("#loginBtn").fadeIn();
      }
      $(".navView input").val("");
    });
});
function sendCode(obj) {
  var number = 60;
  var timer = null;
  if (!$("#phomeImgCode").val()) {
    return $.myAlert({
      message: "请输入图形验证码",
      type: "danger",
    });
  }
  if ($(obj).hasClass("disabled")) return;
  function timerRun() {
    if (number == 0) {
      clearInterval(timer);
      $(obj).removeClass("disabled").html("发送验证码");
    } else {
      $(obj)
        .addClass("disabled")
        .html(number + "s后重新发送");
    }
    number--;
  }
  timerRun();
  timer = setInterval(() => {
    timerRun();
  }, 1000);
}
